package com.deuwise.system.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.deuwise.common.validator.group.AddGroup;
import com.deuwise.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.util.Date;

/**
 * Copyright
 *
 * @author chenwenchao
 * @date 2019/3/19
 * Description:
 */

@Data
@EqualsAndHashCode(callSuper=true)
@TableName("sys_config")
public class ConfigDo extends Model<ConfigDo> implements Serializable {
    /**id主键*/
    @ApiModelProperty("id主键")
    @TableId("id")
    private String id;


    @ApiModelProperty("参数名称")
    @TableField("name")
    @Length(max =60,message ="参数名称长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    private String name;

    @ApiModelProperty("参数值")
    @TableField("value")
    @Length(max =200,message ="参数值长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    private String value;

    @ApiModelProperty("唯一code")
    @TableField("code")
    @Length(max =200,message ="长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    private String code;

    @ApiModelProperty("分组名称")
    @TableField("group_name")
    private String groupName;

    @ApiModelProperty("类型名称")
    @TableField("param_type")
    private String paramType;

    @ApiModelProperty("更新时间")
    @TableField("update_time")
    private Date updateTime;




    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
